const dgram = require('dgram');
const client = dgram.createSocket('udp4');

client.on('error', (err) => {
   console.log(`client error:\n${err.stack}`);
   client.close();
 });

 client.on('message', (fbMsg, fbRinfo) => {
   server.send(fbMsg, rinfo.port, rinfo.address, (err) => {
     err && console.log(err)
   })
   client.close();
 });


 client.send("www.baidu.com", 53, '127.0.0.1', (err) => {
   if (err) {
     console.log(err)
     client.close()
   }
 });